Another Virtue of Wavelet Trees
نویسنده
چکیده
We show how to use a balanced wavelet tree as a data structure that stores a list of numbers and supports efficient range-selection queries. A range-selection query takes a rank and the endpoints of a sublist and returns the number with that rank in that sublist. For example, if the rank is half the sublist’s length, then the query returns the sublist’s median. If someone gives us a list of the closing prices of a stock for the past n days and asks us to find the kth lowest price, then we can do so in O(n) time [1]. We can also preprocess the list in O(n log n) time and store it in O(n) words such that, given k later, we can find the answer in O(1) time: we simply sort the list. However, we might also later face range-selection queries, which have the form “what was the kth lowest price in the interval between the `th and the rth days?”. Of course, we could precompute the answers to all such queries, but storing them would take Ω(n3 log n) bits of space. In this paper we show how to use a balanced wavelet tree to store the list in O(n) words such that we can answer range-selection queries in O(log n) time. We can also answer queries of form “how many times was the price between x and y in the interval between the `th and rth days?” in O(log n) time, but we leave them for a future version of this paper (or as an exercise for the reader). We know of no previous work on range-selection queries, but several authors have written about range-median queries, the special case in which k is half the length of the interval between ` and r. Krizanc, Moran and Smid [9] introduced the problem of preprocessing for range-median queries and gave four solutions, three of which have worse bounds than using a balanced wavelet tree; their fourth solution involves storing O ( n2 log logn/ log n ) words to answer queries in O(1) time. Bose, Kranakis, Morin and Tang [2] then considered approximate queries, and HarPeled and Muthukrishnan [7] and Gfeller and Sanders [5] considered batched queries. Recently, Krizanc et al.’s fourth solution was superseded by one due to Petersen and Grabowski [11,12], who reduced the space bound to O ( n(log log n)2/ log n ) words. Table 1 shows the bounds for Krizanc et al.’s first three solutions, for Petersen and Grabowski’s solution, and for using a balanced wavelet tree. Table 1. Bounds for range-median queries. space (words) time product restriction Krizanc et al. [9] O(n) O(n ) O ( n ) > 0 Krizanc et al. [9] O(n logb n) O ( b log n/ log b ) O ( nb log n/ log b ) 2 ≤ b ≤ n Krizanc et al. [9] O ( n log n/ log log n ) O(logn) O ( n log n/ log logn ) Petersen and O ( n(log logn)/ log n ) O(1) O ( n(log log n)/ log n )
منابع مشابه
Range Quantile Queries: Another Virtue of Wavelet Trees
We show how to use a balanced wavelet tree as a data structure that stores a list of numbers and supports efficient range quantile queries. A range quantile query takes a rank and the endpoints of a sublist and returns the number with that rank in that sublist. For example, if the rank is half the sublist’s length, then the query returns the sublist’s median. We also show how these queries can ...
متن کاملMulla Sadra on Virtue and Action
This paper sheds light on the views of Mulla Sadra about virtue and action. The main question is how he explains the relationship, if any, between virtue and action. Mulla Sadra defines moral virtue as a settled inner disposition by which one acts morally, without need for any reflection or deliberation. This study seeks to explain how, according to Mulla Sadra, a virtue motivates the agent and...
متن کاملThe Features of Biorthogonal Binary Poly-scale Wavelet Packs in Bidimensional Function Space
Wavelet analysis has become a developing branch of mathematics for over twenty years. In this paper, the notion of orthogonal nonseparable bivariate wavelet packs, which is the generalization of orthogonal univariate wavelet packs, is proposed by virtue of analogy method and iteration method. Their biorthogonality traits are researched by using time-frequency analysis approach and variable sepa...
متن کاملGeneration and Characteristics of Vector-Valued Quarternary Wavelets with Poly-scale Dilation Factor
Wavelet analysis has become a developing branch of mathematics for over twenty years. In this paper, the notion of orthogonal nonseparable bivariate wavelet packs, which is the generalization of orthogonal univariate wavelet packs, is proposed by virtue of analogy method and iteration method. Their biorthogonality traits are researched by using time-frequency analysis approach and variable sepa...
متن کاملua nt - p h / 05 08 06 6 v 1 8 A ug 2 00 5 General formula for finding Mexican hat wavelets by virtue of Dirac ’ s representation theory and coherent state
The admissibility condition of a mother wavelet is explored in the context of quantum optics theory. By virtue of Dirac’s representation theory and the coherent state’ property we derive a general formula for finding Mexican hat wavelets.
متن کاملEthical Virtue in Services Organizations of Iran
Background: Ethical organizational culture is a subset of the broader organizational culture that incorporates shared ethical values among the employees of an organization and is maintained through formal and informal organizational systems, thereby creating and maintaining ethical organizational culture. And strengthening it is important for organizations. The purpose of this study was to inve...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/0903.4726 شماره
صفحات -
تاریخ انتشار 2009